package com.zhao.service.impl;


import com.zhao.model.Fruit;
import com.zhao.service.PromotionStrategy;
import com.zhao.uitl.Utils;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Map;

// 无促销
public class NoPromotion implements PromotionStrategy {

    @Override
    public BigDecimal calculate(Map<Fruit, Integer> fruitQuantities) {
        BigDecimal totalPrice = Utils.getTotalPrice(fruitQuantities);
        return totalPrice.setScale(2, RoundingMode.HALF_UP);
    }

    @Override
    public int getPriority() {
        return 3; // 无促销策略优先级最低
    }
}